<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repos\OrderRepo;
use App\Repos\ShopRepo;
use App\Repos\TypeRepo;
use App\Repos\ProductRepo;

class OrderController extends Controller
{
    public function index(Request $request)
    {
    	$where = [];
    	if($request->shop_id){
    		$where['shop_id'] = (int)$request->shop_id;
    	}
        if($request->user_id) {
            $where['user_id'] = (int)$request->user_id;
        }
    	$list  = OrderRepo::paginate($where);
    	$shops = ShopRepo::get();
        $types = TypeRepo::getList();
    	return view('admin.order.index',compact('list','where','shops','types'));
    }

    public function detail($order_id)
    {
    	$data = OrderRepo::find($order_id);
    }
}
